function Commodity(params){ 
	 
}

Commodity.Where = function(type,proxy){
	this.type = type;
	this.proxy=proxy;
	this.linked = null;
	this.set = null;
	if(this.type==0){
		this.set = new Commodity.Where(1,true);
		this.set.linked = this;
	}
	this.getProxy = function(){
		var m = new Commodity.Where(this.type);//当前的对像
		if(this.type==0){
			m.set = new Commodity.Where(1,true);//set对象
			m.set.linked = m;
		}else{
			m.linked=this.linked;
			this.linked.linked=m;
		}
		return m;
	}
	this.data = {};
	this.put = function(key,value){
		this.data[key] = value;
	}
	this.get = function(key){
		return this.data[key];
	}
	/** 编号 [非空]       **/
	this.id=function(id){if(this.proxy)return this.getProxy().id(id);  this.put("id", id);return this;};
	/** and id is null */
	this.idNull=function(){if(this.proxy)return this.getProxy().idNull();if(this.get("idNot")==null)this.put("idNot", "");this.put("id", null);return this;};
	/** not .... */
	this.idNot=function(){if(this.proxy)return this.getProxy().idNot();this.put("idNot", "not");return this;};
	this.idNotNull=function(){if(this.proxy)return this.getProxy().idNotNull();this.put("idNot", "not");this.put("id", null);return this;};
	this.idNot=function(id){if(this.proxy)return this.getProxy().idNot(id);this.put("idNot", "not");this.put("id", id);return this;};
	/** and id <= ? */
	this.idMin=function(min){if(this.proxy)return this.getProxy().idMin(min);this.put("idMin", min);return this;};
	/** and id >= ? */
	this.idMax=function(max){if(this.proxy)return this.getProxy().idMax(max);this.put("idMax", max);return this;};
	this.idIn=function(ids){
		if(this.proxy)return this.getProxy().idIn(ids);  this.put("idIn", ids);return this;
	};	
	
	/** 商品名称 [非空]       **/
	this.name=function(name){if(this.proxy)return this.getProxy().name(name);  this.put("name", name);return this;};
	/** and name is null */
	this.nameNull=function(){if(this.proxy)return this.getProxy().nameNull();if(this.get("nameNot")==null)this.put("nameNot", "");this.put("name", null);return this;};
	/** not .... */
	this.nameNot=function(){if(this.proxy)return this.getProxy().nameNot();this.put("nameNot", "not");return this;};
	this.nameNotNull=function(){if(this.proxy)return this.getProxy().nameNotNull();this.put("nameNot", "not");this.put("name", null);return this;};
	this.nameNot=function(name){if(this.proxy)return this.getProxy().nameNot(name);this.put("nameNot", "not");this.put("name", name);return this;};
	
	/** 标题 [非空]       **/
	this.title=function(title){if(this.proxy)return this.getProxy().title(title);  this.put("title", title);return this;};
	/** and title is null */
	this.titleNull=function(){if(this.proxy)return this.getProxy().titleNull();if(this.get("titleNot")==null)this.put("titleNot", "");this.put("title", null);return this;};
	/** not .... */
	this.titleNot=function(){if(this.proxy)return this.getProxy().titleNot();this.put("titleNot", "not");return this;};
	this.titleNotNull=function(){if(this.proxy)return this.getProxy().titleNotNull();this.put("titleNot", "not");this.put("title", null);return this;};
	this.titleNot=function(title){if(this.proxy)return this.getProxy().titleNot(title);this.put("titleNot", "not");this.put("title", title);return this;};
	
	/** 排序     数值越大越排前   **/
	this.cSort=function(cSort){if(this.proxy)return this.getProxy().cSort(cSort);  this.put("cSort", cSort);return this;};
	/** and c_sort is null */
	this.cSortNull=function(){if(this.proxy)return this.getProxy().cSortNull();if(this.get("cSortNot")==null)this.put("cSortNot", "");this.put("cSort", null);return this;};
	/** not .... */
	this.cSortNot=function(){if(this.proxy)return this.getProxy().cSortNot();this.put("cSortNot", "not");return this;};
	this.cSortNotNull=function(){if(this.proxy)return this.getProxy().cSortNotNull();this.put("cSortNot", "not");this.put("cSort", null);return this;};
	this.cSortNot=function(cSort){if(this.proxy)return this.getProxy().cSortNot(cSort);this.put("cSortNot", "not");this.put("cSort", cSort);return this;};
	/** and c_sort <= ? */
	this.cSortMin=function(min){if(this.proxy)return this.getProxy().cSortMin(min);this.put("cSortMin", min);return this;};
	/** and c_sort >= ? */
	this.cSortMax=function(max){if(this.proxy)return this.getProxy().cSortMax(max);this.put("cSortMax", max);return this;};
	this.cSortIn=function(ids){
		if(this.proxy)return this.getProxy().cSortIn(ids);  this.put("cSortIn", ids);return this;
	};	
	
	/** 所属品牌 [非空] [Merchant]      **/
	this.merchant=function(merchant){if(this.proxy)return this.getProxy().merchant(merchant);  this.put("merchant", merchant);return this;};
	/** and merchant is null */
	this.merchantNull=function(){if(this.proxy)return this.getProxy().merchantNull();if(this.get("merchantNot")==null)this.put("merchantNot", "");this.put("merchant", null);return this;};
	/** not .... */
	this.merchantNot=function(){if(this.proxy)return this.getProxy().merchantNot();this.put("merchantNot", "not");return this;};
	this.merchantNotNull=function(){if(this.proxy)return this.getProxy().merchantNotNull();this.put("merchantNot", "not");this.put("merchant", null);return this;};
	this.merchantNot=function(merchant){if(this.proxy)return this.getProxy().merchantNot(merchant);this.put("merchantNot", "not");this.put("merchant", merchant);return this;};
	this.merchantIn=function(ids){
		if(this.proxy)return this.getProxy().merchantIn(ids);  this.put("merchantIn", ids);return this;
	};	
	
	/** 规格属性 [非空]   text:name     **/
	this.options=function(options){if(this.proxy)return this.getProxy().options(options);  this.put("options", options);return this;};
	/** and options is null */
	this.optionsNull=function(){if(this.proxy)return this.getProxy().optionsNull();if(this.get("optionsNot")==null)this.put("optionsNot", "");this.put("options", null);return this;};
	/** not .... */
	this.optionsNot=function(){if(this.proxy)return this.getProxy().optionsNot();this.put("optionsNot", "not");return this;};
	this.optionsNotNull=function(){if(this.proxy)return this.getProxy().optionsNotNull();this.put("optionsNot", "not");this.put("options", null);return this;};
	this.optionsNot=function(options){if(this.proxy)return this.getProxy().optionsNot(options);this.put("optionsNot", "not");this.put("options", options);return this;};
	
	/** 商品单位  [Unit]      **/
	this.unit=function(unit){if(this.proxy)return this.getProxy().unit(unit);  this.put("unit", unit);return this;};
	/** and unit is null */
	this.unitNull=function(){if(this.proxy)return this.getProxy().unitNull();if(this.get("unitNot")==null)this.put("unitNot", "");this.put("unit", null);return this;};
	/** not .... */
	this.unitNot=function(){if(this.proxy)return this.getProxy().unitNot();this.put("unitNot", "not");return this;};
	this.unitNotNull=function(){if(this.proxy)return this.getProxy().unitNotNull();this.put("unitNot", "not");this.put("unit", null);return this;};
	this.unitNot=function(unit){if(this.proxy)return this.getProxy().unitNot(unit);this.put("unitNot", "not");this.put("unit", unit);return this;};
	this.unitIn=function(ids){
		if(this.proxy)return this.getProxy().unitIn(ids);  this.put("unitIn", ids);return this;
	};	
	
	/** 配送费 [非空]       **/
	this.distriFee=function(distriFee){if(this.proxy)return this.getProxy().distriFee(distriFee);  this.put("distriFee", distriFee);return this;};
	/** and distri_fee is null */
	this.distriFeeNull=function(){if(this.proxy)return this.getProxy().distriFeeNull();if(this.get("distriFeeNot")==null)this.put("distriFeeNot", "");this.put("distriFee", null);return this;};
	/** not .... */
	this.distriFeeNot=function(){if(this.proxy)return this.getProxy().distriFeeNot();this.put("distriFeeNot", "not");return this;};
	this.distriFeeNotNull=function(){if(this.proxy)return this.getProxy().distriFeeNotNull();this.put("distriFeeNot", "not");this.put("distriFee", null);return this;};
	this.distriFeeNot=function(distriFee){if(this.proxy)return this.getProxy().distriFeeNot(distriFee);this.put("distriFeeNot", "not");this.put("distriFee", distriFee);return this;};
	/** and distri_fee <= ? */
	this.distriFeeMin=function(min){if(this.proxy)return this.getProxy().distriFeeMin(min);this.put("distriFeeMin", min);return this;};
	/** and distri_fee >= ? */
	this.distriFeeMax=function(max){if(this.proxy)return this.getProxy().distriFeeMax(max);this.put("distriFeeMax", max);return this;};
	
	/** 叠加配送费 [非空]       **/
	this.overFee=function(overFee){if(this.proxy)return this.getProxy().overFee(overFee);  this.put("overFee", overFee);return this;};
	/** and over_fee is null */
	this.overFeeNull=function(){if(this.proxy)return this.getProxy().overFeeNull();if(this.get("overFeeNot")==null)this.put("overFeeNot", "");this.put("overFee", null);return this;};
	/** not .... */
	this.overFeeNot=function(){if(this.proxy)return this.getProxy().overFeeNot();this.put("overFeeNot", "not");return this;};
	this.overFeeNotNull=function(){if(this.proxy)return this.getProxy().overFeeNotNull();this.put("overFeeNot", "not");this.put("overFee", null);return this;};
	this.overFeeNot=function(overFee){if(this.proxy)return this.getProxy().overFeeNot(overFee);this.put("overFeeNot", "not");this.put("overFee", overFee);return this;};
	/** and over_fee <= ? */
	this.overFeeMin=function(min){if(this.proxy)return this.getProxy().overFeeMin(min);this.put("overFeeMin", min);return this;};
	/** and over_fee >= ? */
	this.overFeeMax=function(max){if(this.proxy)return this.getProxy().overFeeMax(max);this.put("overFeeMax", max);return this;};
	
	/** 商品描述 [非空]       **/
	this.descr=function(descr){if(this.proxy)return this.getProxy().descr(descr);  this.put("descr", descr);return this;};
	/** and descr is null */
	this.descrNull=function(){if(this.proxy)return this.getProxy().descrNull();if(this.get("descrNot")==null)this.put("descrNot", "");this.put("descr", null);return this;};
	/** not .... */
	this.descrNot=function(){if(this.proxy)return this.getProxy().descrNot();this.put("descrNot", "not");return this;};
	this.descrNotNull=function(){if(this.proxy)return this.getProxy().descrNotNull();this.put("descrNot", "not");this.put("descr", null);return this;};
	this.descrNot=function(descr){if(this.proxy)return this.getProxy().descrNot(descr);this.put("descrNot", "not");this.put("descr", descr);return this;};
	
	/** 轮播图 [非空]       **/
	this.shufs=function(shufs){if(this.proxy)return this.getProxy().shufs(shufs);  this.put("shufs", shufs);return this;};
	/** and shufs is null */
	this.shufsNull=function(){if(this.proxy)return this.getProxy().shufsNull();if(this.get("shufsNot")==null)this.put("shufsNot", "");this.put("shufs", null);return this;};
	/** not .... */
	this.shufsNot=function(){if(this.proxy)return this.getProxy().shufsNot();this.put("shufsNot", "not");return this;};
	this.shufsNotNull=function(){if(this.proxy)return this.getProxy().shufsNotNull();this.put("shufsNot", "not");this.put("shufs", null);return this;};
	this.shufsNot=function(shufs){if(this.proxy)return this.getProxy().shufsNot(shufs);this.put("shufsNot", "not");this.put("shufs", shufs);return this;};
	
	/** 列表图 [非空]       **/
	this.image=function(image){if(this.proxy)return this.getProxy().image(image);  this.put("image", image);return this;};
	/** and image is null */
	this.imageNull=function(){if(this.proxy)return this.getProxy().imageNull();if(this.get("imageNot")==null)this.put("imageNot", "");this.put("image", null);return this;};
	/** not .... */
	this.imageNot=function(){if(this.proxy)return this.getProxy().imageNot();this.put("imageNot", "not");return this;};
	this.imageNotNull=function(){if(this.proxy)return this.getProxy().imageNotNull();this.put("imageNot", "not");this.put("image", null);return this;};
	this.imageNot=function(image){if(this.proxy)return this.getProxy().imageNot(image);this.put("imageNot", "not");this.put("image", image);return this;};
	
	/** 假销量 [非空]       **/
	this.saleVol=function(saleVol){if(this.proxy)return this.getProxy().saleVol(saleVol);  this.put("saleVol", saleVol);return this;};
	/** and sale_vol is null */
	this.saleVolNull=function(){if(this.proxy)return this.getProxy().saleVolNull();if(this.get("saleVolNot")==null)this.put("saleVolNot", "");this.put("saleVol", null);return this;};
	/** not .... */
	this.saleVolNot=function(){if(this.proxy)return this.getProxy().saleVolNot();this.put("saleVolNot", "not");return this;};
	this.saleVolNotNull=function(){if(this.proxy)return this.getProxy().saleVolNotNull();this.put("saleVolNot", "not");this.put("saleVol", null);return this;};
	this.saleVolNot=function(saleVol){if(this.proxy)return this.getProxy().saleVolNot(saleVol);this.put("saleVolNot", "not");this.put("saleVol", saleVol);return this;};
	/** and sale_vol <= ? */
	this.saleVolMin=function(min){if(this.proxy)return this.getProxy().saleVolMin(min);this.put("saleVolMin", min);return this;};
	/** and sale_vol >= ? */
	this.saleVolMax=function(max){if(this.proxy)return this.getProxy().saleVolMax(max);this.put("saleVolMax", max);return this;};
	this.saleVolIn=function(ids){
		if(this.proxy)return this.getProxy().saleVolIn(ids);  this.put("saleVolIn", ids);return this;
	};	
	
	/** 真实销量        **/
	this.raleVol=function(raleVol){if(this.proxy)return this.getProxy().raleVol(raleVol);  this.put("raleVol", raleVol);return this;};
	/** and rale_vol is null */
	this.raleVolNull=function(){if(this.proxy)return this.getProxy().raleVolNull();if(this.get("raleVolNot")==null)this.put("raleVolNot", "");this.put("raleVol", null);return this;};
	/** not .... */
	this.raleVolNot=function(){if(this.proxy)return this.getProxy().raleVolNot();this.put("raleVolNot", "not");return this;};
	this.raleVolNotNull=function(){if(this.proxy)return this.getProxy().raleVolNotNull();this.put("raleVolNot", "not");this.put("raleVol", null);return this;};
	this.raleVolNot=function(raleVol){if(this.proxy)return this.getProxy().raleVolNot(raleVol);this.put("raleVolNot", "not");this.put("raleVol", raleVol);return this;};
	/** and rale_vol <= ? */
	this.raleVolMin=function(min){if(this.proxy)return this.getProxy().raleVolMin(min);this.put("raleVolMin", min);return this;};
	/** and rale_vol >= ? */
	this.raleVolMax=function(max){if(this.proxy)return this.getProxy().raleVolMax(max);this.put("raleVolMax", max);return this;};
	this.raleVolIn=function(ids){
		if(this.proxy)return this.getProxy().raleVolIn(ids);  this.put("raleVolIn", ids);return this;
	};	
	
	/** 价格 [非空]       **/
	this.price=function(price){if(this.proxy)return this.getProxy().price(price);  this.put("price", price);return this;};
	/** and price is null */
	this.priceNull=function(){if(this.proxy)return this.getProxy().priceNull();if(this.get("priceNot")==null)this.put("priceNot", "");this.put("price", null);return this;};
	/** not .... */
	this.priceNot=function(){if(this.proxy)return this.getProxy().priceNot();this.put("priceNot", "not");return this;};
	this.priceNotNull=function(){if(this.proxy)return this.getProxy().priceNotNull();this.put("priceNot", "not");this.put("price", null);return this;};
	this.priceNot=function(price){if(this.proxy)return this.getProxy().priceNot(price);this.put("priceNot", "not");this.put("price", price);return this;};
	/** and price <= ? */
	this.priceMin=function(min){if(this.proxy)return this.getProxy().priceMin(min);this.put("priceMin", min);return this;};
	/** and price >= ? */
	this.priceMax=function(max){if(this.proxy)return this.getProxy().priceMax(max);this.put("priceMax", max);return this;};
	
	/** 划线价格     显示在商品详情页的划线价格；   **/
	this.cPrice=function(cPrice){if(this.proxy)return this.getProxy().cPrice(cPrice);  this.put("cPrice", cPrice);return this;};
	/** and c_price is null */
	this.cPriceNull=function(){if(this.proxy)return this.getProxy().cPriceNull();if(this.get("cPriceNot")==null)this.put("cPriceNot", "");this.put("cPrice", null);return this;};
	/** not .... */
	this.cPriceNot=function(){if(this.proxy)return this.getProxy().cPriceNot();this.put("cPriceNot", "not");return this;};
	this.cPriceNotNull=function(){if(this.proxy)return this.getProxy().cPriceNotNull();this.put("cPriceNot", "not");this.put("cPrice", null);return this;};
	this.cPriceNot=function(cPrice){if(this.proxy)return this.getProxy().cPriceNot(cPrice);this.put("cPriceNot", "not");this.put("cPrice", cPrice);return this;};
	/** and c_price <= ? */
	this.cPriceMin=function(min){if(this.proxy)return this.getProxy().cPriceMin(min);this.put("cPriceMin", min);return this;};
	/** and c_price >= ? */
	this.cPriceMax=function(max){if(this.proxy)return this.getProxy().cPriceMax(max);this.put("cPriceMax", max);return this;};
	
	/** 分区价格    tree:area menoy:price     **/
	this.zonePrice=function(zonePrice){if(this.proxy)return this.getProxy().zonePrice(zonePrice);  this.put("zonePrice", zonePrice);return this;};
	/** and zone_price is null */
	this.zonePriceNull=function(){if(this.proxy)return this.getProxy().zonePriceNull();if(this.get("zonePriceNot")==null)this.put("zonePriceNot", "");this.put("zonePrice", null);return this;};
	/** not .... */
	this.zonePriceNot=function(){if(this.proxy)return this.getProxy().zonePriceNot();this.put("zonePriceNot", "not");return this;};
	this.zonePriceNotNull=function(){if(this.proxy)return this.getProxy().zonePriceNotNull();this.put("zonePriceNot", "not");this.put("zonePrice", null);return this;};
	this.zonePriceNot=function(zonePrice){if(this.proxy)return this.getProxy().zonePriceNot(zonePrice);this.put("zonePriceNot", "not");this.put("zonePrice", zonePrice);return this;};
	
	/** 充多少 [非空]       **/
	this.howMuch=function(howMuch){if(this.proxy)return this.getProxy().howMuch(howMuch);  this.put("howMuch", howMuch);return this;};
	/** and how_much is null */
	this.howMuchNull=function(){if(this.proxy)return this.getProxy().howMuchNull();if(this.get("howMuchNot")==null)this.put("howMuchNot", "");this.put("howMuch", null);return this;};
	/** not .... */
	this.howMuchNot=function(){if(this.proxy)return this.getProxy().howMuchNot();this.put("howMuchNot", "not");return this;};
	this.howMuchNotNull=function(){if(this.proxy)return this.getProxy().howMuchNotNull();this.put("howMuchNot", "not");this.put("howMuch", null);return this;};
	this.howMuchNot=function(howMuch){if(this.proxy)return this.getProxy().howMuchNot(howMuch);this.put("howMuchNot", "not");this.put("howMuch", howMuch);return this;};
	/** and how_much <= ? */
	this.howMuchMin=function(min){if(this.proxy)return this.getProxy().howMuchMin(min);this.put("howMuchMin", min);return this;};
	/** and how_much >= ? */
	this.howMuchMax=function(max){if(this.proxy)return this.getProxy().howMuchMax(max);this.put("howMuchMax", max);return this;};
	this.howMuchIn=function(ids){
		if(this.proxy)return this.getProxy().howMuchIn(ids);  this.put("howMuchIn", ids);return this;
	};	
	
	/** 赠多少 [非空]       **/
	this.howMany=function(howMany){if(this.proxy)return this.getProxy().howMany(howMany);  this.put("howMany", howMany);return this;};
	/** and how_many is null */
	this.howManyNull=function(){if(this.proxy)return this.getProxy().howManyNull();if(this.get("howManyNot")==null)this.put("howManyNot", "");this.put("howMany", null);return this;};
	/** not .... */
	this.howManyNot=function(){if(this.proxy)return this.getProxy().howManyNot();this.put("howManyNot", "not");return this;};
	this.howManyNotNull=function(){if(this.proxy)return this.getProxy().howManyNotNull();this.put("howManyNot", "not");this.put("howMany", null);return this;};
	this.howManyNot=function(howMany){if(this.proxy)return this.getProxy().howManyNot(howMany);this.put("howManyNot", "not");this.put("howMany", howMany);return this;};
	/** and how_many <= ? */
	this.howManyMin=function(min){if(this.proxy)return this.getProxy().howManyMin(min);this.put("howManyMin", min);return this;};
	/** and how_many >= ? */
	this.howManyMax=function(max){if(this.proxy)return this.getProxy().howManyMax(max);this.put("howManyMax", max);return this;};
	this.howManyIn=function(ids){
		if(this.proxy)return this.getProxy().howManyIn(ids);  this.put("howManyIn", ids);return this;
	};	
	
	/** 二维码        **/
	this.cQrCode=function(cQrCode){if(this.proxy)return this.getProxy().cQrCode(cQrCode);  this.put("cQrCode", cQrCode);return this;};
	/** and c_qr_code is null */
	this.cQrCodeNull=function(){if(this.proxy)return this.getProxy().cQrCodeNull();if(this.get("cQrCodeNot")==null)this.put("cQrCodeNot", "");this.put("cQrCode", null);return this;};
	/** not .... */
	this.cQrCodeNot=function(){if(this.proxy)return this.getProxy().cQrCodeNot();this.put("cQrCodeNot", "not");return this;};
	this.cQrCodeNotNull=function(){if(this.proxy)return this.getProxy().cQrCodeNotNull();this.put("cQrCodeNot", "not");this.put("cQrCode", null);return this;};
	this.cQrCodeNot=function(cQrCode){if(this.proxy)return this.getProxy().cQrCodeNot(cQrCode);this.put("cQrCodeNot", "not");this.put("cQrCode", cQrCode);return this;};
	
	/** 修改时间 [非空]       **/
	this.updateTime=function(updateTime){if(this.proxy)return this.getProxy().updateTime(updateTime);  this.put("updateTime", updateTime);return this;};
	/** and update_time is null */
	this.updateTimeNull=function(){if(this.proxy)return this.getProxy().updateTimeNull();if(this.get("updateTimeNot")==null)this.put("updateTimeNot", "");this.put("updateTime", null);return this;};
	/** not .... */
	this.updateTimeNot=function(){if(this.proxy)return this.getProxy().updateTimeNot();this.put("updateTimeNot", "not");return this;};
	this.updateTimeNotNull=function(){if(this.proxy)return this.getProxy().updateTimeNotNull();this.put("updateTimeNot", "not");this.put("updateTime", null);return this;};
	this.updateTimeNot=function(updateTime){if(this.proxy)return this.getProxy().updateTimeNot(updateTime);this.put("updateTimeNot", "not");this.put("updateTime", updateTime);return this;};
	/** and update_time >= ? */
	this.updateTimeStart=function(start){if(this.proxy)return this.getProxy().updateTimeStart(start);this.put("updateTimeStart", start);return this;};			
	/** and update_time <= ? */
	this.updateTimeEnd=function(end){if(this.proxy)return this.getProxy().updateTimeEnd(end);this.put("updateTimeEnd", end);return this;};
	
	/** 添加时间 [非空]       **/
	this.addTime=function(addTime){if(this.proxy)return this.getProxy().addTime(addTime);  this.put("addTime", addTime);return this;};
	/** and add_time is null */
	this.addTimeNull=function(){if(this.proxy)return this.getProxy().addTimeNull();if(this.get("addTimeNot")==null)this.put("addTimeNot", "");this.put("addTime", null);return this;};
	/** not .... */
	this.addTimeNot=function(){if(this.proxy)return this.getProxy().addTimeNot();this.put("addTimeNot", "not");return this;};
	this.addTimeNotNull=function(){if(this.proxy)return this.getProxy().addTimeNotNull();this.put("addTimeNot", "not");this.put("addTime", null);return this;};
	this.addTimeNot=function(addTime){if(this.proxy)return this.getProxy().addTimeNot(addTime);this.put("addTimeNot", "not");this.put("addTime", addTime);return this;};
	/** and add_time >= ? */
	this.addTimeStart=function(start){if(this.proxy)return this.getProxy().addTimeStart(start);this.put("addTimeStart", start);return this;};			
	/** and add_time <= ? */
	this.addTimeEnd=function(end){if(this.proxy)return this.getProxy().addTimeEnd(end);this.put("addTimeEnd", end);return this;};
	
	/** 状态 [非空]   1:正常 0:无效     **/
	this.status=function(status){if(this.proxy)return this.getProxy().status(status);  this.put("status", status);return this;};
	/** and status is null */
	this.statusNull=function(){if(this.proxy)return this.getProxy().statusNull();if(this.get("statusNot")==null)this.put("statusNot", "");this.put("status", null);return this;};
	/** not .... */
	this.statusNot=function(){if(this.proxy)return this.getProxy().statusNot();this.put("statusNot", "not");return this;};
	this.statusNotNull=function(){if(this.proxy)return this.getProxy().statusNotNull();this.put("statusNot", "not");this.put("status", null);return this;};
	this.statusNot=function(status){if(this.proxy)return this.getProxy().statusNot(status);this.put("statusNot", "not");this.put("status", status);return this;};
	this.statusIn=function(ids){
		if(this.proxy)return this.getProxy().statusIn(ids);  this.put("statusIn", ids);return this;
	};	
	
	
	
	this.add=function(key,value) {if(proxy)return proxy().add(key,value);this.put(key, value);return this;}
	this.desc=function(sql) {if(proxy)return proxy().desc(sql);this.put("desc", sql);return this;}
	this.asc=function(sql) {if(proxy)return proxy().asc(sql);this.put("asc", sql);return this;}
	this.definex=function(sql) {if(proxy)return proxy().definex(sql);this.put("definex", sql);return this;}
	
	/** 获取所有商品信息 **/
	this.list=function(size){
		this.data.size = size;
		var protocol = ux.ajax("/admin/goods/commodity.list.do",this.data);
		if(!protocol)return null;
		if(protocol.data && protocol.data.list)return protocol.data.list;
		return [];
	}
	/** 获取商品信息分页 **/
	this.page=function(page,size){
		this.data.size = size;
		this.data.page = page;
		var protocol = ux.ajax("/admin/goods/commodity.list.do",this.data);
		if(!protocol)return null;
		if(protocol.data)return data;
		return {list:[]};
	}
	/** 根据查询条件取商品信息 **/
	this.get=function(){
		this.data.size = 1;
		var protocol = ux.ajax("/admin/goods/commodity.list.do",this.data);
		if(!protocol)return null;
		if(protocol.data && protocol.data.list && protocol.data.list.length==1)return protocol.data.list[0]; 
		return null;
	}
}

Commodity.get = function(id){
	var protocol = ux.ajax("/admin/goods/commodity.get.do",{id:id});
	if(!protocol)return null;
	if(protocol.data)return protocol.data.commodity;
	return null;
}

Commodity.where = new Commodity.Where(0,true);